<?$this->extend("layout/default")?>

<div id="tabs">
	<ul>
		<li><a href="#main"> Tableau de bord </a></li>
		<li><a href="#devis"> Devis </a></li>
		<li><a href="#facture"> Factures </a></li>
		<li><a href="#paiements"> Paiements </a></li>
	</ul>
	<div id="main">
		<div class="configbox corner">
			<?=$this->inc("ventes/dashboard",
			array("plot_nb_devis"=>$plot_nb_devis,"plot_nb_factures"=>$plot_nb_factures,
					"ca_mensuel"=>$ca_mensuel,"produits"=>$produits,"charges"=>$charges));?>
		</div>
	</div>
	<div id="devis">
		<div class="configbox corner">
			<?=$this->inc("ventes/devis",
				array("devis"=>$devis,"aContacts"=>$aContacts,
					 "typesReglements"=>$typesReglements,"aTVA"=>$aTVA,"planComptable"=>$planComptable,
					 "aDevisFactures"=>$aDevisFactures));?>
		</div>
	</div>
	<div id="facture">
		<div class="configbox corner">
			<?=$this->inc("ventes/facture",array("factures"=>$factures,"aContacts"=>$aContacts,"aPaiementsClient"=>$aPaiementsClient));?>
		</div>
	</div>
	<div id="paiements">
		<div class="configbox corner">
			<?=$this->inc("ventes/paiements",array("factures"=>$factures,"aContacts"=>$aContacts,"aPaiementsClient"=>$aPaiementsClient));?>
		</div>
	</div>
</div>
<script>
<?php 
	if(isset($_GET["devis"])) $idSelected = "1";
	elseif(isset($_GET["factures"])) $idSelected = "2";
	elseif(isset($_GET["paiements"])) $idSelected = "3";
	else $idSelected = "0";
?>
$(document).ready(function() {
	$( "#tabs" ).tabs("select", <?=$idSelected?> );
});
</script>
<div id="preview"></div>